package com.jxc.jxc01.hch.entity;

import java.util.Objects;

/**
 * 商品资料对象
 */
public class Commodity {
    private int id;
    private String name;
    private int classify;
    private String specs;
    private double price;
    private String creationTime;
    private String updateTime;

    public Commodity() {
    }

    public Commodity(int id, String name, int classify, String specs, double price, String creationTime, String updateTime) {
        this.id = id;
        this.name = name;
        this.classify = classify;
        this.specs = specs;
        this.price = price;
        this.creationTime = creationTime;
        this.updateTime = updateTime;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getClassify() {
        return classify;
    }

    public void setClassify(int classify) {
        this.classify = classify;
    }

    public String getSpecs() {
        return specs;
    }

    public void setSpecs(String specs) {
        this.specs = specs;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public String getCreationTime() {
        return creationTime;
    }

    public void setCreationTime(String creationTime) {
        this.creationTime = creationTime;
    }

    public String getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(String updateTime) {
        this.updateTime = updateTime;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Commodity commodity = (Commodity) o;
        return id == commodity.id && classify == commodity.classify && Double.compare(commodity.price, price) == 0 && Objects.equals(name, commodity.name) && Objects.equals(specs, commodity.specs) && Objects.equals(creationTime, commodity.creationTime) && Objects.equals(updateTime, commodity.updateTime);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, name, classify, specs, price, creationTime, updateTime);
    }

    @Override
    public String toString() {
        return "Commodity{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", classify=" + classify +
                ", specs='" + specs + '\'' +
                ", price=" + price +
                ", creationTime='" + creationTime + '\'' +
                ", updateTime='" + updateTime + '\'' +
                '}';
    }
}
